import request from '@/utils/request'


/**
 * 分级查看影院、影片以及场次的收益情况
 * @param params
 * @returns {*}
 */
export function statistics(params) {
  return request({
    url: '/ticket-order/api/v1/oms/statistics',
    method: 'get',
    params: params
  })
}


/**
 * 购票（生成订单）
 * @param data
 * @returns {*}
 */
export function addOrder(data) {
  return request({
    url: '/ticket-order/api/v1/oms/outer/order',
    method: 'post',
    data: data
  })
}

/**
 * 购票（支付订单）
 * @param uuid
 * @returns {*}
 */
export function paidOrder(uuid) {
  return request({
    url: '/ticket-order/api/v1/oms/outer/order/paid?uuid='+uuid,
    method: 'put'
  })
}

/**
 * 退票
 * @param uuid
 * @returns {*}
 */
export function refundOrder(uuid) {
  return request({
    url: '/ticket-order/api/v1/oms/outer/order/refund?uuid='+uuid,
    method: 'put'
  })
}
/**
 * 检票
 * @param uuid
 * @returns {*}
 */
export function checkOrder(uuid) {
  return request({
    url: '/ticket-order/api/v1/oms/order/used?uuid='+uuid,
    method: 'put'
  })
}

/**
 * 分页获取购票订单
 * @param params
 * @returns {*}
 */
export function listTicketOrders(params) {
  return request({
    url: '/ticket-order/api/v1/oms/outer/orders',
    method: 'get',
    params: params
  })
}

/**
 * 充值（生成订单）
 * @param data
 * @returns {*}
 */
export function addTopUpOrder(data) {
  return request({
    url: '/ticket-order/api/v1/tms/outer/topUpOrder',
    method: 'post',
    data: data
  })
}

/**
 * 充值（支付订单）
 * @param uuid
 * @returns {*}
 */
export function paidTopUpOrder(uuid) {
  return request({
    url: '/ticket-order/api/v1/tms/outer/topUpOrder/paid?uuid='+uuid,
    method: 'put'
  })
}

/**
 * 取消订单
 * @param uuid
 * @returns {*}
 */
export function refundTopUpOrder(uuid) {
  return request({
    url: '/ticket-order/api/v1/tms/outer/topUpOrder/refund?uuid='+uuid,
    method: 'put'
  })
}

/**
 * 分页获取充值订单
 * @param params
 * @returns {*}
 */
export function listTopUpOrders(params) {
  return request({
    url: '/ticket-order/api/v1/tms/outer/topUpOrders',
    method: 'get',
    params: params
  })
}


